
/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package Apusic.impl;

import Apusic.ApusicPackage;
import Apusic.HttpSessionStoreCfg;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import javax.management.ObjectName;
import org.eclipse.emf.ecore.EObject;
import com.apusic.admin.config.*;
import com.apusic.admin.*;

import cn.edu.pku.sei.ra.wrapping.CommonWrapping.WrappingEObject;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.impl.WrappingEObjectImpl;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectContainmentEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.EObjectResolvingEListForWrapping;
import cn.edu.pku.sei.ra.wrapping.CommonWrapping.util.ImagePool;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Http Session Store Cfg</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link Apusic.impl.HttpSessionStoreCfgImpl#getDirectory <em>Directory</em>}</li>
 *   <li>{@link Apusic.impl.HttpSessionStoreCfgImpl#getDataSourceName <em>Data Source Name</em>}</li>
 *   <li>{@link Apusic.impl.HttpSessionStoreCfgImpl#getTableName <em>Table Name</em>}</li>
 *   <li>{@link Apusic.impl.HttpSessionStoreCfgImpl#getCreateTableSQL <em>Create Table SQL</em>}</li>
 *   <li>{@link Apusic.impl.HttpSessionStoreCfgImpl#getCurrentStoreType <em>Current Store Type</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HttpSessionStoreCfgImpl extends WrappingEObjectImpl implements HttpSessionStoreCfg
{
  /**
   * The default value of the '{@link #getDirectory() <em>Directory</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDirectory()
   * @generated
   * @ordered
   */
  protected static final String DIRECTORY_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getDirectory() <em>Directory</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDirectory()
   * @generated
   * @ordered
   */
  protected String directory = DIRECTORY_EDEFAULT;

  /**
   * The default value of the '{@link #getDataSourceName() <em>Data Source Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDataSourceName()
   * @generated
   * @ordered
   */
  protected static final String DATA_SOURCE_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getDataSourceName() <em>Data Source Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDataSourceName()
   * @generated
   * @ordered
   */
  protected String dataSourceName = DATA_SOURCE_NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getTableName() <em>Table Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getTableName()
   * @generated
   * @ordered
   */
  protected static final String TABLE_NAME_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getTableName() <em>Table Name</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getTableName()
   * @generated
   * @ordered
   */
  protected String tableName = TABLE_NAME_EDEFAULT;

  /**
   * The default value of the '{@link #getCreateTableSQL() <em>Create Table SQL</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCreateTableSQL()
   * @generated
   * @ordered
   */
  protected static final String CREATE_TABLE_SQL_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getCreateTableSQL() <em>Create Table SQL</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCreateTableSQL()
   * @generated
   * @ordered
   */
  protected String createTableSQL = CREATE_TABLE_SQL_EDEFAULT;

  /**
   * The default value of the '{@link #getCurrentStoreType() <em>Current Store Type</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCurrentStoreType()
   * @generated
   * @ordered
   */
  protected static final String CURRENT_STORE_TYPE_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getCurrentStoreType() <em>Current Store Type</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getCurrentStoreType()
   * @generated
   * @ordered
   */
  protected String currentStoreType = CURRENT_STORE_TYPE_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected HttpSessionStoreCfgImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return ApusicPackage.Literals.HTTP_SESSION_STORE_CFG;
  }

  
  

  
  
  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
   public boolean isForCore(Object arg0){
   	boolean result=true;
   	if(core==null) return false;
    try{
    result=true;
    }
    catch(Exception e){
      result=false;
    }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public List listSubCores(int featureID){
    List result=new ArrayList();
  
    HttpSessionStoreConfig core=(HttpSessionStoreConfig)this.getCore();
    if(core==null) 
      return result;
    switch(featureID){
    
  
  
  
  
  
  }
    return result;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */ 
  public EClass getChildClassMap(Object object){
    ApusicPackage pack=ApusicPackage.eINSTANCE;	
  
  
  
  
  
  
    return null;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getDirectory()
  {
        Object result=null;
        HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
        if(core==null) return directory;	
        try
{
directory=core.getDirectory();
}
catch(Exception e)
{
  directory = null;
}
    return directory; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDirectory(String newDirectory)
  {
    String oldDirectory = directory;
    directory = newDirectory;
        	
      HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_SESSION_STORE_CFG__DIRECTORY, oldDirectory, directory));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getDataSourceName()
  {
        Object result=null;
        HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
        if(core==null) return dataSourceName;	
        try
{
dataSourceName=core.getDataSourceName();
}
catch(Exception e)
{
  dataSourceName = null;
}
    return dataSourceName; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDataSourceName(String newDataSourceName)
  {
    String oldDataSourceName = dataSourceName;
    dataSourceName = newDataSourceName;
        	
      HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_SESSION_STORE_CFG__DATA_SOURCE_NAME, oldDataSourceName, dataSourceName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getTableName()
  {
        Object result=null;
        HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
        if(core==null) return tableName;	
        try
{
tableName=core.getTableName();
}
catch(Exception e)
{
  tableName = null;
}
    return tableName; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setTableName(String newTableName)
  {
    String oldTableName = tableName;
    tableName = newTableName;
        	
      HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_SESSION_STORE_CFG__TABLE_NAME, oldTableName, tableName));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getCreateTableSQL()
  {
        Object result=null;
        HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
        if(core==null) return createTableSQL;	
        try
{
createTableSQL=core.getCreateTableSQL();
}
catch(Exception e)
{
  createTableSQL = null;
}
    return createTableSQL; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setCreateTableSQL(String newCreateTableSQL)
  {
    String oldCreateTableSQL = createTableSQL;
    createTableSQL = newCreateTableSQL;
        	
      HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_SESSION_STORE_CFG__CREATE_TABLE_SQL, oldCreateTableSQL, createTableSQL));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getCurrentStoreType()
  {
        Object result=null;
        HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
        if(core==null) return currentStoreType;	
        try
{
currentStoreType=core.getCurrentStoreType();
}
catch(Exception e)
{
  currentStoreType = null;
}
    return currentStoreType; 
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setCurrentStoreType(String newCurrentStoreType)
  {
    String oldCurrentStoreType = currentStoreType;
    currentStoreType = newCurrentStoreType;
        	
      HttpSessionStoreConfig core=(HttpSessionStoreConfig)getCore();
      if(core==null) return;
      	
        
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, ApusicPackage.HTTP_SESSION_STORE_CFG__CURRENT_STORE_TYPE, oldCurrentStoreType, currentStoreType));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case ApusicPackage.HTTP_SESSION_STORE_CFG__DIRECTORY:
        return getDirectory();
      case ApusicPackage.HTTP_SESSION_STORE_CFG__DATA_SOURCE_NAME:
        return getDataSourceName();
      case ApusicPackage.HTTP_SESSION_STORE_CFG__TABLE_NAME:
        return getTableName();
      case ApusicPackage.HTTP_SESSION_STORE_CFG__CREATE_TABLE_SQL:
        return getCreateTableSQL();
      case ApusicPackage.HTTP_SESSION_STORE_CFG__CURRENT_STORE_TYPE:
        return getCurrentStoreType();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case ApusicPackage.HTTP_SESSION_STORE_CFG__DIRECTORY:
        setDirectory((String)newValue);
        return;
      case ApusicPackage.HTTP_SESSION_STORE_CFG__DATA_SOURCE_NAME:
        setDataSourceName((String)newValue);
        return;
      case ApusicPackage.HTTP_SESSION_STORE_CFG__TABLE_NAME:
        setTableName((String)newValue);
        return;
      case ApusicPackage.HTTP_SESSION_STORE_CFG__CREATE_TABLE_SQL:
        setCreateTableSQL((String)newValue);
        return;
      case ApusicPackage.HTTP_SESSION_STORE_CFG__CURRENT_STORE_TYPE:
        setCurrentStoreType((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.HTTP_SESSION_STORE_CFG__DIRECTORY:
        setDirectory(DIRECTORY_EDEFAULT);
        return;
      case ApusicPackage.HTTP_SESSION_STORE_CFG__DATA_SOURCE_NAME:
        setDataSourceName(DATA_SOURCE_NAME_EDEFAULT);
        return;
      case ApusicPackage.HTTP_SESSION_STORE_CFG__TABLE_NAME:
        setTableName(TABLE_NAME_EDEFAULT);
        return;
      case ApusicPackage.HTTP_SESSION_STORE_CFG__CREATE_TABLE_SQL:
        setCreateTableSQL(CREATE_TABLE_SQL_EDEFAULT);
        return;
      case ApusicPackage.HTTP_SESSION_STORE_CFG__CURRENT_STORE_TYPE:
        setCurrentStoreType(CURRENT_STORE_TYPE_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case ApusicPackage.HTTP_SESSION_STORE_CFG__DIRECTORY:
        return DIRECTORY_EDEFAULT == null ? directory != null : !DIRECTORY_EDEFAULT.equals(directory);
      case ApusicPackage.HTTP_SESSION_STORE_CFG__DATA_SOURCE_NAME:
        return DATA_SOURCE_NAME_EDEFAULT == null ? dataSourceName != null : !DATA_SOURCE_NAME_EDEFAULT.equals(dataSourceName);
      case ApusicPackage.HTTP_SESSION_STORE_CFG__TABLE_NAME:
        return TABLE_NAME_EDEFAULT == null ? tableName != null : !TABLE_NAME_EDEFAULT.equals(tableName);
      case ApusicPackage.HTTP_SESSION_STORE_CFG__CREATE_TABLE_SQL:
        return CREATE_TABLE_SQL_EDEFAULT == null ? createTableSQL != null : !CREATE_TABLE_SQL_EDEFAULT.equals(createTableSQL);
      case ApusicPackage.HTTP_SESSION_STORE_CFG__CURRENT_STORE_TYPE:
        return CURRENT_STORE_TYPE_EDEFAULT == null ? currentStoreType != null : !CURRENT_STORE_TYPE_EDEFAULT.equals(currentStoreType);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (directory: ");
    result.append(directory);
    result.append(", dataSourceName: ");
    result.append(dataSourceName);
    result.append(", tableName: ");
    result.append(tableName);
    result.append(", createTableSQL: ");
    result.append(createTableSQL);
    result.append(", currentStoreType: ");
    result.append(currentStoreType);
    result.append(')');
    return result.toString();
  }

} //HttpSessionStoreCfgImpl
